package de.op.projectc.stats;

/**
 * Created by andy on 08.05.14.
 */
public class Score {
    private static Score instance = null;

    private int currentScore;
    private int currentHighScore;
    private int highScore;

    public int getCurrentScore() {
        return currentScore;
    }

    public int getCurrentHighScore() {
        return currentHighScore;
    }

    public int getHighScore() {
        return highScore;
    }

    protected Score() {
        this.currentScore = 0;
        this.currentHighScore = 0;

        loadHighScore();
    }

    public static Score getInstance() {
        if(instance == null) {
            instance = new Score();
        }
        return instance;
    }

    //TODO Highscore von Datei laden
    private void loadHighScore() {
        this.highScore = 0;
    }

    public void updateScore(float value) {
        this.currentHighScore = (int) Math.max(this.currentHighScore, value);
        this.highScore = (int) Math.max(this.highScore, value);
        this.currentScore = (int) value;
    }
}